Skip to content

Resolve filter field names case-insensitively - #243

Merged
EnriqueL8 merged 1 commit into
mainfrom
filter-field-case-insensitive
Sep 18, 2026
Merged

EnriqueL8 merged 1 commit into
mainfrom
filter-field-case-insensitive

Conversation

@awrichar

@awrichar awrichar commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Currently a QueryFields map only supports lowercase field names, because Finalize lowercases the field name before looking it up. Sort, GroupBy and RequiredFields instead match exactly, and silently drop anything else. Query JSON also matches field names directly, so you are forced to only have lowercase keys in JSON filters.

With this change, mixed-case filter fields are now declarable.

QueryFields.Resolve matches a field name exactly, then falls back to a case-insensitive match, and returns the name as declared. This applies to filter params as well as sort, group by, and fields.

Currently a QueryFields map only supports lowercase field names, because
Finalize lowercases the field name before looking it up. Sort, GroupBy and
RequiredFields instead match exactly, and silently drop anything else.

With this change, mixed-case filter fields are now declarable.

QueryFields.Resolve matches a field name exactly, then falls back to a
case-insensitive match, and returns the name as declared. This applies
to filter params as well as sort, group by, and fields.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @awrichar this looks good to me!

@EnriqueL8
EnriqueL8 merged commit 0dd2e22 into main Sep 18, 2026
3 checks passed
@EnriqueL8
EnriqueL8 deleted the filter-field-case-insensitive branch September 18, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants